const views = require('koa-views');
const stc = require('koa-static');
const { resolve } = require('path');

const abPath = path => resolve(__dirname, path);

/**
 * 生产环境 production
 * @param {*} app 
 */
export const dev = async app => {
    // 配置静态web服务的中间件
    app.use(stc(abPath('../../../dist')));

    // // 配置视图中间件
    // app.use(views(abPath('../../../dist')), {
    //     extension: 'html'
    // });

    // app.use(async ctx => {
    //     console.log(123);
    //     ctx.type = 'text/html';
    //     await ctx.render('index.html');
    // })
}